package com.myrock.zlbandy.gorock.rock.tools;

import android.content.Context;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * Created by zlbandy on 2017/9/9.
 */

public class NetRequest {

    private static RequestQueue mQueue = null;
    private static Lock lock = new ReentrantLock();
    private static final String NETREQUEST = "netrequest";

    public static RequestQueue getInstance(Context context) {
        if (mQueue == null) {
            lock.lock();
            if (mQueue == null) {
                mQueue = Volley.newRequestQueue(context.getApplicationContext());
            }
            lock.unlock();
        }
        return mQueue;
    }
}
